//
//  PrivateOrganizationListViewController.m
//  Utils
//
//  Created by enghou on 2018/5/1.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "PrivateOrganizationListViewController.h"
#import "PrivateSearchViewController.h"
#import "PrivateOrgDetailViewController.h"
#import "OrganizationItemModel.h"
@interface PrivateOrganizationListViewController ()

@end

@implementation PrivateOrganizationListViewController

-(void)searchAction{
    PrivateSearchViewController *search = (PrivateSearchViewController *)[VCLoader vcWithName:@"PrivateSearchViewController"];
    search.title = @"非公有制经济组织搜索";
    search.theDelete = self;
    [self push:search];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(beginRefresh) name:@"refresh_private_org" object:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)addAction{

    PrivateOrgDetailViewController *orgDetail = [[PrivateOrgDetailViewController alloc]init];
    
    orgDetail.title = @"非公有制经济组织新增";
    
    [self push:orgDetail];
}

#pragma mark - Table view data source

-(void)pushWithId:(NSString *)ids{
    [self alertSome:@"该功能暂未开放"];
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    OrganizationItemModel *model = self.source[indexPath.row];
    
    PrivateOrgDetailViewController *orgDetail = [[PrivateOrgDetailViewController alloc]init];
    
    orgDetail.ids = model.ids;
    
    orgDetail.title = @"非公有制经济组织详情";
    
    [self push:orgDetail];
    
}

-(void)fetchModel:(id)model{
    self.choosenParam = model;
    [self beginRefresh];
}


@end
